﻿using System;
using System.Windows.Navigation;
using Microsoft.Phone.Tasks;

namespace Phoenix.Tasks
{
    public interface ITaskManager
    {
        void StartTask<TChooser, TTaskEventArgs>(Action<TTaskEventArgs> onComplete)
            where TChooser : ChooserBase<TTaskEventArgs>, new()
            where TTaskEventArgs : TaskEventArgs;

        void ComposeEmail(
            string to = null,
            string cc = null,
            string bcc = null,
            string subject = null,
            string body = null,
            int? codePage = null);

        /// <summary>
        /// Launches the browser task
        /// </summary>
        /// <param name="uri"></param>
        void ShowWebsiteInBrowser(string uri);

        /// <summary>
        /// Navigates to an InApp page with a browser control, optionally showing the appbar with a LaunchInIE button and 
        /// callbacks when the browser control navigates (useful for oauth)
        /// </summary>
        /// <param name="uri"></param>
        /// <param name="showAppBar">Should we show the app bar with the option to launch in IE</param>
        /// <param name="navigateCallback">Callback if you want to know when the web browser control navigates</param>
        /// <param name="loadCompleteCallback">Callback if you want to know when the web browser finishes loading content</param>
        void ShowWebsiteInApp(string uri, bool showAppBar = true,
            Action<NavigationEventArgs, NavigationService> navigateCallback = null,
            Action<NavigationEventArgs, string, NavigationService> loadCompleteCallback = null);
    }
}
